var CusNameSpace = window.CusNameSpace || {};



/*
<<<<<<< HEAD
Class CusEventHandle
*/
CusNameSpace.CusEventHandle=function() {
  this.name = 'CusEventHandle';
};
CusNameSpace.CusEventHandle.prototype.evHandlPrimaryState=function(primaryMenuIdName,blockSecondMenuIdName) {
	/*二级菜单子窗口-显示当前所需的并隐藏其他多余的*/
	var primaryMenuIdNamejq = "#" + primaryMenuIdName;
	var secondMenuSubIdName = $(primaryMenuIdNamejq).attr("cussubid");

	/*子菜单*/
	if(secondMenuSubIdName === "second_menu_manual")
	{
		//手动
		this.evHandlSecondMenu("second_manual_manual");
	}
	else if(secondMenuSubIdName === "second_menu_msg")
	{
		//消息
		this.evHandlSecondMenu("second_msg_info");
	}
	else
	{
		//左侧二级菜单
		var blockSecondMenuIdNamejq = "#"+blockSecondMenuIdName;
		$(blockSecondMenuIdNamejq).css("display","block");
		this.dlgSecondMenuShow(secondMenuSubIdName);
	}
};
CusNameSpace.CusEventHandle.prototype.dlgSecondMenuShow=function(secondMenuIdName) {
	$(".second_menu").css("display","none");
	var elementIdName = "#"+secondMenuIdName;
	$(elementIdName).css("display","block");

};
CusNameSpace.CusEventHandle.prototype.secondMenuHide= function(e) {
	
		/*获取鼠标事件*/
		/*e = e || window.event;
	  __xx = e.pageX || e.clientX + document.body.scroolLeft;
	  __yy = e.pageY || e.clientY + document.body.scrollTop;*/
		/*隐藏*/
	var clickedElementId = new Array();
	var currentElement = $(e.target);

	clickedElementId[0] = currentElement.attr("menuflag");
	clickedElementId[1] = currentElement.parent().attr("menuflag");
	clickedElementId[2] = currentElement.parent().parent().attr("menuflag");

	var isHasMenuFlag = false;
	for(var i = 0;i<3;i++)
	{
		if(clickedElementId[i] !== undefined)
		{
			if(clickedElementId[i] === "true")
			{
				isHasMenuFlag = true;
			}

		}
	}

	if(isHasMenuFlag !== true)
	{
		$("#block_second_menu").css("display","none");
	}
};

CusNameSpace.CusEventHandle.prototype.evHandlSecondMenu=function(secondMenuIdName){
	
	var willShowPageId = "";
	var secondMenuIdNamejq = "#"+secondMenuIdName;
	willShowPageId = $(secondMenuIdNamejq).attr("cuspageid");
	var contentPageIdNamejq = "#"+willShowPageId;
	/*先隐藏所有*/
	$(".content_page_m_child").css("display","none");
	/*显示当前需要的*/
	$(contentPageIdNamejq).css("display","block");
};
/*--------------------top事件--------------------*/
CusNameSpace.CusEventHandle.prototype.evHandlTopState=function(primaryMenuIdName) {
	if(primaryMenuIdName === "top_right_state_msg")
	{
		//消息显示大窗口
		this.evHandlSecondMenu("second_msg_info");
	}
	else if(primaryMenuIdName === "top_right_state_position")
	{
		//消息显示大窗口
		this.evHandlSecondMenu("second_process_view");
	}
	else
	{
		/*二级菜单子窗口-显示当前所需的并隐藏其他多余的*/
		//document.getElementById('pop_light').style.display='block';
		//document.getElementById('pop_fade').style.display='block';
		$("#pop_light").css("display","block");
		$("#pop_fade").css("display","block");
		var primaryMenuIdNamejq = "#" + primaryMenuIdName;
		var secondMenuSubIdName = $(primaryMenuIdNamejq).attr("cussubid");
		//弹框显示控制
		$(".top_state_pop_window").css("display","none");
		var elementIdName = "#"+secondMenuSubIdName;
		$(elementIdName).css("display","block");
	}
};
CusNameSpace.CusEventHandle.prototype.topMenuHide= function(e) {
	
	/*获取鼠标事件*/
	/*e = e || window.event;
	__xx = e.pageX || e.clientX + document.body.scroolLeft;
	__yy = e.pageY || e.clientY + document.body.scrollTop;*/
			
	/*隐藏*/

	var currentElement = $(e.target);
	var clickedElementId = new Array();
	clickedElementId[0] = currentElement.attr("popflag");
	clickedElementId[1] = currentElement.parent().attr("popflag");
	clickedElementId[2] = currentElement.parent().parent().attr("popflag");
	clickedElementId[3] = currentElement.parent().parent().parent().attr("popflag");
	
	var isHasMenuFlag = false;
	for(var i = 0;i<4;i++)
	{
		if(clickedElementId[i] !== undefined)
		{
			if(clickedElementId[i] === "true")
			{
				isHasMenuFlag = true;
			}

		}
	}
	if(isHasMenuFlag !== true)
	{
		$("#pop_fade").css("display","none");
		$("#pop_light").css("display","none");
	}
=======
 Class CusEventHandle
 */
CusNameSpace.CusEventHandle = function () {
    this.name = 'CusEventHandle';
};
CusNameSpace.CusEventHandle.prototype.evHandlPrimaryState = function (primaryMenuIdName, blockSecondMenuIdName) {
    /*二级菜单子窗口-显示当前所需的并隐藏其他多余的*/
    var primaryMenuIdNamejq = "#" + primaryMenuIdName;
    var secondMenuSubIdName = $(primaryMenuIdNamejq).attr("cussubid");

    /*子菜单*/
    if (secondMenuSubIdName === "second_menu_manual")
    {
        //手动
        this.evHandlSecondMenu("second_manual_manual");
        $("#page_manual_m_manual").trigger("click");
    } 
    else if (secondMenuSubIdName === "second_menu_msg")
    {
        //消息
        this.evHandlSecondMenu("second_msg_info");
    } 
    else
    {
        if(primaryMenuIdName ==="func_process")
        {
            if( $("#page_process_m_position").css("display")==="block")
            {
                window.objGlobalManage.jumpProgramFileStringWindowOpen=0;
            }
            if(window.objGlobalManage.jumpProgramFileStringWindowOpen==1)
            {
                $("#second_process_position").click();
                this.windowShowHideProgramView("page_process_m_position_fileline");
            }
            else
            {
                var blockSecondMenuIdNamejq = "#" + blockSecondMenuIdName;
                $(blockSecondMenuIdNamejq).css("display", "block");
                this.dlgSecondMenuShow(secondMenuSubIdName);
            }
        }
        else
        {
            var blockSecondMenuIdNamejq = "#" + blockSecondMenuIdName;
            $(blockSecondMenuIdNamejq).css("display", "block");
            this.dlgSecondMenuShow(secondMenuSubIdName);
        }
    }
};
CusNameSpace.CusEventHandle.prototype.dlgSecondMenuShow = function (secondMenuIdName) {
    $(".second_menu").css("display", "none");
    var elementIdName = "#" + secondMenuIdName;
    $(elementIdName).css("display", "block");

};
CusNameSpace.CusEventHandle.prototype.secondMenuHide = function (e) {

    /*获取鼠标事件*/
    /*e = e || window.event;
     __xx = e.pageX || e.clientX + document.body.scroolLeft;
     __yy = e.pageY || e.clientY + document.body.scrollTop;*/
    /*隐藏*/
    var clickedElementId = new Array();
    var currentElement = $(e.target);

    clickedElementId[0] = currentElement.attr("menuflag");
    clickedElementId[1] = currentElement.parent().attr("menuflag");
    clickedElementId[2] = currentElement.parent().parent().attr("menuflag");

    var isHasMenuFlag = false;
    for (var i = 0; i < 3; i++)
    {
        if (clickedElementId[i] !== undefined)
        {
            if (clickedElementId[i] === "true")
            {
                isHasMenuFlag = true;
            }

        }
    }

    if (isHasMenuFlag !== true)
    {
        $("#block_second_menu").css("display", "none");
    }
};

CusNameSpace.CusEventHandle.prototype.evHandlSecondMenu = function (secondMenuIdName) {

    var willShowPageId = "";
    var secondMenuIdNamejq = "#" + secondMenuIdName;
    willShowPageId = $(secondMenuIdNamejq).attr("cuspageid");
    var contentPageIdNamejq = "#" + willShowPageId;
    /*先隐藏所有*/
    $(".content_page_m_child").css("display", "none");
    /*显示当前需要的*/
    $(contentPageIdNamejq).css("display", "block");
};
/*--------------------top事件--------------------*/
CusNameSpace.CusEventHandle.prototype.evHandlTopState = function (primaryMenuIdName) {
    if (primaryMenuIdName === "top_right_state_msg")
    {
        //消息显示大窗口
        this.evHandlSecondMenu("second_msg_info");
    } else if (primaryMenuIdName === "top_right_state_position")
    {
        //消息显示大窗口
        this.evHandlSecondMenu("second_process_view");
    } else
    {
        /*二级菜单子窗口-显示当前所需的并隐藏其他多余的*/
        //document.getElementById('pop_light').style.display='block';
        //document.getElementById('pop_fade').style.display='block';
        $("#pop_light").css("display", "block");
        $("#pop_fade").css("display", "block");
        var primaryMenuIdNamejq = "#" + primaryMenuIdName;
        var secondMenuSubIdName = $(primaryMenuIdNamejq).attr("cussubid");
        //弹框显示控制
        $(".top_state_pop_window").css("display", "none");
        var elementIdName = "#" + secondMenuSubIdName;
        $(elementIdName).css("display", "block");
    }
};
CusNameSpace.CusEventHandle.prototype.topMenuHide = function (e) {

    /*获取鼠标事件*/
    /*e = e || window.event;
     __xx = e.pageX || e.clientX + document.body.scroolLeft;
     __yy = e.pageY || e.clientY + document.body.scrollTop;*/

    /*隐藏*/

    var currentElement = $(e.target);
    var clickedElementId = new Array();
    clickedElementId[0] = currentElement.attr("popflag");
    clickedElementId[1] = currentElement.parent().attr("popflag");
    clickedElementId[2] = currentElement.parent().parent().attr("popflag");
    clickedElementId[3] = currentElement.parent().parent().parent().attr("popflag");

    var isHasMenuFlag = false;
    for (var i = 0; i < 4; i++)
    {
        if (clickedElementId[i] !== undefined)
        {
            if (clickedElementId[i] === "true")
            {
                isHasMenuFlag = true;
            }

        }
    }
    if (isHasMenuFlag !== true)
    {
        $("#pop_fade").css("display", "none");
        $("#pop_light").css("display", "none");
    }
>>>>>>> dev
};


//按钮 button 类型事件处理
<<<<<<< HEAD
CusNameSpace.CusEventHandle.prototype.eventBtHandle=function(e) {

	var targetElement = $(e.target);
	var targetId = targetElement.attr("id");
	var targetClass=targetElement.attr("class");
	//Class
	if(targetClass.indexOf("cl_bt_page_state_m_map_list") !== -1)
	{
		//右下状态页 地图列表加载按钮
		var itemIndex = targetElement.attr("item-index");
		if(itemIndex !== "" && itemIndex>=0)
		{
			objGlobalVariable.objCusUpdateTopState.selectMapNameIndex = itemIndex;
			var mapName = objGlobalVariable.objCusUpdateTopState.arrayMapName[itemIndex];

			var cmdRowParent = {};
			var cmdRowChild = {};
			cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
			cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
			cmdRowChild.map_name=mapName;
			cmdRowParent.set_load_map = cmdRowChild;
			var sendData=JSON.stringify(cmdRowParent);
			objGlobalVariable.objWebSocket.sendMessage(sendData);
		}
	}
	else if(targetClass.indexOf("cl_bt_page_state_m_do_list") != -1)
	{
		//右下状态页 地图列表加载按钮
		var itemIndex = 0;
		itemIndex = targetElement.attr("item-index");
		if(itemIndex != "" && itemIndex>=0)
		{

			objGlobalVariable.objCusUpdateTopState.selectDoIndex = itemIndex;
			var doState = 0;
			if(objGlobalVariable.objCusUpdateTopState.arrayDoState[itemIndex] == enumTypeDoState.kDoClose)
			{
				doState = enumTypeDoState.kDoOpen;
				//targetElement.text("开");
			}
			else
			{
				doState = enumTypeDoState.kDoClose;
				//targetElement.text("关");
			}
			
			var cmdRowParent = {};
			var cmdRowChild = {};
			cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
			cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
			cmdRowChild.index=Number(itemIndex);
			cmdRowChild.value=doState;
		
			cmdRowParent.set_do = cmdRowChild;
			var sendData=JSON.stringify(cmdRowParent);
			objGlobalVariable.objWebSocket.sendMessage(sendData);

			//objGlobalVariable.objCusEventHandle.requestDivState("second_state_ioinfo");

		}
	}


	//ID
	if(targetId === "modle_bt_login_general")
	{
		//操作员
		objGlobalVariable.objCusUpdateTopState.variable_state_user = enumTypeUser.kUseGeneral;

		$("#modle_bt_login_general").css("background-color","#3d4e60");
		$("#modle_bt_login_manager").css("background-color","#337ab7");
	}
	else if(targetId === "modle_bt_login_manager")
	{
		//管理员
		objGlobalVariable.objCusUpdateTopState.variable_state_user = enumTypeUser.kUserManage; 
		$("#modle_bt_login_general").css("background-color","#337ab7");
		$("#modle_bt_login_manager").css("background-color","#3d4e60");
	}
	else if(targetId === "modle_bt_login")
	{
		//发送登录信息

		var inputPassWd="";
		//获取密码
		inputPassWd = $("#modle_in_login_pass").val();

		

		do{
			if(objGlobalVariable.objCusUpdateTopState.variable_state_user === -1)
			{
				//提示选择用户
                                popTipWindowMsg("请选择用户\n");
				break;
			}
			
			if(inputPassWd.length<=0)
			{
				//提示输入密码
				popTipWindowMsg("请输入密码\n");
				break;

			}
			var cmdRowParent = {};
			var cmdRowChild = {};
			
			cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
			cmdRowChild.user_password=inputPassWd;
			cmdRowChild.parameter=0;
			
			cmdRowParent.set_login = cmdRowChild;
			var sendData=JSON.stringify(cmdRowParent);
			objGlobalVariable.objWebSocket.sendMessage(sendData);
			
			//记录登录密码
			objGlobalVariable.objCusUpdateTopState.loginPassWd=inputPassWd;
                        
                        //顶部显示用户角色
                        if(objGlobalVariable.objCusUpdateTopState.variable_state_user == enumTypeUser.kUserManage)
                        {
                            $("#id_top_pop_user").text("管理员");
                        }
                        else
                        {
                            $("#id_top_pop_user").text("普通用户");
                        }
                        
                       
                        
		}while(0);
	}
	else if(targetId === "id_top_pop_w_servo_open")
	{
		var cmdRowParent = {};
		var cmdRowChild = {};
		
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.ison=1;
		
		cmdRowParent.set_servo = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId === "id_top_pop_w_servo_close")
	{
		var cmdRowParent = {};
		var cmdRowChild = {};
		
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.ison=0;
		
		cmdRowParent.set_servo = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId === "id_top_pop_w_clear_msg")
	{
		var cmdRowParent = {};
		var cmdRowChild = {};

		
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_clear_msg = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId === "id_content_map_create_map")
	{
		//创建地图
		var cmdRowParent = {};
		var cmdRowChild = {};
		
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_create_map_start = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId === "id_content_map_save_map")
	{
		//保存文件名
		var cmdRowParent = {};
		var cmdRowChild = {};
		var mapName="";
		
		mapName = $("#id_content_map_input_name").val();

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.map_name=mapName;
		
		cmdRowParent.set_save_map = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId === "id_top_pop_w_odometer_zero")
	{
		//清除里程
		var cmdRowParent = {};
		var cmdRowChild = {};


		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_clear_odomter = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"id_top_state_pop_w_mode_t1")
	{
		//模式T1
		var cmdRowParent = {};
		var cmdRowChild = {};


		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.mode=enumTypeMode.kModeT1;
		
		cmdRowParent.set_mode = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);

		$(".group_top_pop_mode").css("background-color","#337ab7");
		$("#"+targetId).css("background-color","#3d4e60");
	}
	else if(targetId ===　"id_top_state_pop_w_mode_t2")
	{
		//模式T２
		var cmdRowParent = {};
		var cmdRowChild = {};


		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.mode=enumTypeMode.kModeT2;
		
		cmdRowParent.set_mode = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);


		$(".group_top_pop_mode").css("background-color","#337ab7");
		$("#"+targetId).css("background-color","#3d4e60");
	}
	else if(targetId ===　"id_top_state_pop_w_mode_auto")
	{
		//自动
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.mode=enumTypeMode.kModeAuto;
		
		cmdRowParent.set_mode = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);

		$(".group_top_pop_mode").css("background-color","#337ab7");
		$("#"+targetId).css("background-color","#3d4e60");
	}
	else if(targetId ===　"id_top_state_pop_w_mode_ext")
	{
		//自动
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.mode=enumTypeMode.kModeExt;
		
		cmdRowParent.set_mode = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);

		$(".group_top_pop_mode").css("background-color","#337ab7");
		$("#"+targetId).css("background-color","#3d4e60");
	}
	else if(targetId ===　"id_top_state_pop_w_run_run")
	{
		//運行
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_run = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"id_top_state_pop_w_run_pause")
	{
		//暫停
		var cmdRowParent = {};
		var cmdRowChild = {};


		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_cease = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"id_top_state_pop_w_run_stop")
	{
		//停止
		var cmdRowParent = {};
		var cmdRowChild = {};


		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		
		cmdRowParent.set_stop = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"id_top_state_pop_w_run_open")
	{
		//打开程序-加载程序文件
		var itemIndex = objGlobalVariable.objCusUpdateTopState.selectProgramOpenIndex;
		var programName = objGlobalVariable.objCusUpdateTopState.arrayProgramOpen[itemIndex];
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.file_name=programName;
		
		cmdRowParent.set_current_running_program_file = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"connectWebsocket")
	{
		//web socket 连接   
		var serverIp = window.location.host;
		var serverPort = 8800;
		objGlobalVariable.objWebSocket.setServerIpPort(serverIp,serverPort);
		objGlobalVariable.objWebSocket.initWebSocket();

	}
	else if(targetId ===　"closeWebsocket")
	{
		//web socket 关闭   
		objGlobalVariable.objWebSocket.stopWebSocket();

	}
	else if(targetId ===　"id_pop_w_set_position_initial")
	{
		//设置初始位置
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.position_x=objGlobalVariable.objCusUpdateTopState.position_x;
		cmdRowChild.position_y=objGlobalVariable.objCusUpdateTopState.position_y;
		cmdRowChild.position_r=objGlobalVariable.objCusUpdateTopState.position_r;

		cmdRowParent.set_vehicle_initial_position = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(targetId ===　"id_pop_w_process_fileline_back")
	{
		//程序点位文件数据列表返回
                //显示程序-查看-子窗口
                objGlobalVariable.objCusEventHandle.windowShowHideProgramView("page_process_m_position_filename");
	}
	else if(targetId ===　"id_pop_w_process_file_dp_position_back")
	{
		//程序　读取点位置　返回
                objGlobalVariable.objCusEventHandle.windowShowHideProgramView("page_process_m_position_fileline");
	}
	else if(targetId ===　"id_pop_w_process_file_dp_position_set")
	{
		//程序　读取点位置　返回
		objGlobalVariable.programSetVehiclePostion = 1;
		this.evHandlPopInputShow();

	}
	else if(targetId ===　"id_pop_w_process_fileline_load")
	{
            
		var selFileNameIndex = objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex;
		if(selFileNameIndex >= 0)
		{
			var fileDataInfo = objGlobalVariable.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
			var selFileLineIndex = fileDataInfo.selectLine;
			var stringLine = fileDataInfo.arrayFileData[selFileLineIndex];

			

			if(stringLine.indexOf("VMark[") != -1)
			{
				if(stringLine.indexOf("DP[") != -1)
				{

					//vmark值获取
					var dpIndex = -1;
					var vmarkIndex = -1;
					//截取字符串　vmark
					{
						var strItem = "";
						var splitFlag = "";

						var tempData = stringLine;
						
						splitFlag = tempData.indexOf("VMark[");
						splitLen = tempData.length-splitFlag;
						tempData = tempData.substr(splitFlag,splitLen);

						splitFlag = tempData.indexOf("VMark[") + 6;
						var splitLen = 0;
						splitLen = tempData.length-splitFlag;
						strItem = tempData.substr(splitFlag,splitLen);
						splitFlag = strItem.indexOf("]");
						strItem = strItem.substr(0,splitFlag);
						vmarkIndex = strItem;
					}

					//截取DP点
					{
						var strItem = "";
						var splitFlag = "";
						var tempData = stringLine;
						splitFlag = tempData.indexOf("DP[");
						splitLen = tempData.length-splitFlag;
						tempData = tempData.substr(splitFlag,splitLen);
	
						splitFlag = tempData.indexOf("DP[") + 3;
						var splitLen = 0;
                                                
	
						splitLen = tempData.length-splitFlag;
	
						strItem = tempData.substr(splitFlag,splitLen);
						splitFlag = strItem.indexOf("]");
						strItem = strItem.substr(0,splitFlag);
						dpIndex = strItem;
					}
					
					var cmdRowParent = {};
					var cmdRowChild = {};

					cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
					cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
					cmdRowChild.program_file_name=fileDataInfo.fileName;
					cmdRowChild.map_name=objGlobalVariable.objCusUpdateTopState.variable_map_name;

					cmdRowChild.dpoint_index=dpIndex;

					if(vmarkIndex == 0)
					{
						cmdRowChild.dpoint_x=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_map_x*1000.0;
						cmdRowChild.dpoint_y=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_map_y*1000.0;
						cmdRowChild.dpoint_r=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_map_r*180/3.1415926;
						cmdRowParent.set_record_dpoint = cmdRowChild;
                                                
						var sendData=JSON.stringify(cmdRowParent);
                 
						objGlobalVariable.objWebSocket.sendMessage(sendData);
					}
					else if(vmarkIndex > 0)
					{
						cmdRowChild.dpoint_x=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_vmark_x*1000;
						cmdRowChild.dpoint_y=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_vmark_y*1000;
						cmdRowChild.dpoint_r=objGlobalVariable.objCusUpdateTopState.current_vehicle_position_vmark_r*180/3.1415926;
						cmdRowParent.set_record_dpoint = cmdRowChild;
						var sendData=JSON.stringify(cmdRowParent);
                                 
						objGlobalVariable.objWebSocket.sendMessage(sendData);
					}
					else
					{
						popTipWindowMsg("VMARK取值错误!");
					}
				}	
			}	
		}
	}
	else if(targetId ===　"id_pop_w_process_fileline_read")
	{
		//程序点位文件数据列表读取
		var selFileNameIndex = objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex;
		if(selFileNameIndex >= 0)
		{
			var fileDataInfo = objGlobalVariable.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
			var selFileLineIndex = fileDataInfo.selectLine;
			var stringLine = fileDataInfo.arrayFileData[selFileLineIndex];
			if(stringLine.indexOf("DP[") != -1)
			{
				//vmark值获取
				var dpIndex = -1;
				var vmarkIndex = -1;
				
				//截取DP点
				{
					var strItem = "";
					var splitFlag = "";
					var tempData = stringLine;
					splitFlag = tempData.indexOf("DP[");
					splitLen = tempData.length-splitFlag;
					tempData = tempData.substr(splitFlag,splitLen);

					splitFlag = tempData.indexOf("DP[") + 3;
					var splitLen = 0;

					splitLen = tempData.length-splitFlag;
					
					strItem = tempData.substr(splitFlag,splitLen);
					splitFlag = strItem.indexOf("]");
					strItem = strItem.substr(0,splitFlag);

					
					dpIndex = strItem;

					
				}

				var cmdRowParent = {};
				var cmdRowChild = {};
                                
                                var currentFileIndex = objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex;
                                var programPositionInfo = objGlobalVariable.objCusUpdateTopState.arrayProgramPosition[currentFileIndex];
                                
                               
				cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
				cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
				//cmdRowChild.program_file_name=fileDataInfo.fileName;
				//cmdRowChild.map_name=objGlobalVariable.objCusUpdateTopState.variable_map_name;
				cmdRowChild.point_index=dpIndex;
                                cmdRowChild.file_name=programPositionInfo.fileName;
				cmdRowParent.get_dpoint = cmdRowChild;
				var sendData=JSON.stringify(cmdRowParent);
 
				objGlobalVariable.objWebSocket.sendMessage(sendData);
				
			}		
		}
	}
        else if(targetId === "id_content_set_vmark_commit")
	{
		//
                var cmdRowParent = {};
                var cmdRowChild = {};
                var vmarkValue = "";
                vmarkValue = $("#id_content_set_vmark_type").val();
                
                cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
                cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
                //cmdRowChild.program_file_name=fileDataInfo.fileName;
                //cmdRowChild.map_name=objGlobalVariable.objCusUpdateTopState.variable_map_name;
                cmdRowChild.vmark_type=parseInt(vmarkValue);
                cmdRowParent.set_vmark_type = cmdRowChild;
                var sendData=JSON.stringify(cmdRowParent);
                objGlobalVariable.objWebSocket.sendMessage(sendData);

	}
        else if(targetId === "id_top_pop_user")
	{
		//当前用户 重新登陆
                window.location.reload();
	}
        else if(targetId === "id_bt_avoid_ultrasonicsensor_enable")
	{
		//超声波检测设置
                var cmdRowParent = {};
                var cmdRowChild = {};
                var vmarkValue = "";
                
                cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
                cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
                cmdRowChild.check_enable=objGlobalVariable.objCusUpdateTopState.objAvoidInfo.ultrasonicSensorEnable;
                
                if(objGlobalVariable.objCusUpdateTopState.objAvoidInfo.ultrasonicSensorEnable === enumTypeUltrasonicSensorEnable.kUltrasonicSensorOpen)
                {
                    cmdRowChild.check_enable=enumTypeUltrasonicSensorEnable.kUltrasonicSensorClose;
                }
                else
                {
                    cmdRowChild.check_enable=enumTypeUltrasonicSensorEnable.kUltrasonicSensorOpen;
                }
                
                cmdRowParent.set_ultrasonic_sensor_check_enable = cmdRowChild;
                var sendData=JSON.stringify(cmdRowParent);
                objGlobalVariable.objWebSocket.sendMessage(sendData);
                
	}
        else if(targetId === "id_bt_avoid_pointcloud_enable")
	{
		//点云检测设置
                var cmdRowParent = {};
                var cmdRowChild = {};
                var vmarkValue = "";
                
                cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
                cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
                
                if(objGlobalVariable.objCusUpdateTopState.objAvoidInfo.pointCloudEnable === enumTypePointCloudEnable.kPointCloudOpen)
                {
                    cmdRowChild.check_enable=enumTypePointCloudEnable.kPointCloudClose;
                }
                else
                {
                    cmdRowChild.check_enable=enumTypePointCloudEnable.kPointCloudOpen;
                }
                
                cmdRowParent.set_point_cloud_check_enable = cmdRowChild;
                var sendData=JSON.stringify(cmdRowParent);
                objGlobalVariable.objWebSocket.sendMessage(sendData);
                
	}
        
        
	else if(targetId === "")
	{
		//
	}
};
CusNameSpace.CusEventHandle.prototype.refreshSliderCmdHandle=function(elelementId,value) {

	var elementId = elelementId;
	if(elementId == "slider-1")
	{
		//手动速度
		objGlobalVariable.objCusUpdateTopState.variable_state_manual_v=value;
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type = objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password = objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.ratio = objGlobalVariable.objCusUpdateTopState.variable_state_manual_v;

		cmdRowParent.set_manual_ratio = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(elementId == "slider-2")
	{
		//自动速度
		objGlobalVariable.objCusUpdateTopState.variable_state_auto_v=value;
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.ratio=objGlobalVariable.objCusUpdateTopState.variable_state_auto_v;

		cmdRowParent.set_auto_ratio = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}

};

//div事件
CusNameSpace.CusEventHandle.prototype.eventDivHandle=function(e) {

	var targetElement = $(e.target);
	var itemDiv = new Array();
	var itemId = new Array();

	itemDiv[0] = targetElement.attr("class");
	itemId[0] = targetElement.attr("id");
	itemDiv[1] = targetElement.parent().attr("class");
	itemId[1] = targetElement.parent().attr("id");
	itemDiv[2] = targetElement.parent().parent().attr("class");
	itemId[2] = targetElement.parent().parent().attr("id");
	itemDiv[3] = targetElement.parent().parent().parent().attr("class");
	itemId[3] = targetElement.parent().parent().parent().attr("id");
	
	for(var itemIndex = 0;itemIndex<4;itemIndex++)
	{
		var currentItem = itemDiv[itemIndex];
		var currentId = itemId[itemIndex];
		if(typeof(currentItem)  != "undefined")
		{
			if(currentItem.indexOf("primary_nva")!=-1)
			{
				this.evHandlPrimaryState(itemId[itemIndex],"block_second_menu");
				$(".primary_nva").removeClass("primary_nva_active");
				$("#"+itemId[itemIndex]).addClass("primary_nva_active");
				
                                //初始化程序界面子窗口
                                objGlobalVariable.objCusEventHandle.windowShowHideProgramView("page_process_m_position_filename");
                                //请求数据
				this.requestDivState(itemId[itemIndex]);
			}
			else if(currentItem.indexOf("second_menu_nva") != -1)
			{
				this.evHandlSecondMenu(itemId[itemIndex]);
				$(".second_menu_nva").removeClass("second_menu_nva_active");
				$("#"+itemId[itemIndex]).addClass("second_menu_nva_active");
				//请求数据
				this.requestDivState(itemId[itemIndex]);
			}
			else if(currentItem.indexOf("top_menu_nva") != -1)
			{
				//顶部按钮按下事件
				clickPrimaryIdName = $(this).attr("id");
				this.evHandlTopState(itemId[itemIndex]);
		
				$(".top_menu_nva").removeClass("top_menu_nva_active");
				$("#"+itemId[itemIndex]).addClass("top_menu_nva_active");

				this.requestDivState(itemId[itemIndex]);
			}
			else if(currentItem.indexOf("c_second_menu_list_item") != -1)
			{
				$(".c_second_menu_list_item").css("background-color","#3d4151");
				$("#"+itemId[itemIndex]).css("background-color","#3d4e60");
			}
			else if(currentItem.indexOf("c_pop_black_overlay_input") != -1)
			{
				this.requestDivState(itemId[itemIndex]);
			}
			else if(currentItem.indexOf("c_page_state_m_process_item") != -1)
			{
				//程序打开
				var currentIndex = $("#"+currentId).attr("item-index");
				
				if(currentIndex != "")
				{
					
					objGlobalVariable.objCusUpdateTopState.selectProgramOpenIndex = currentIndex;
				}
				//objGlobalVariable.objCusUpdateTopState.arrayProgram[itemIndex];
				$(".c_page_state_m_process_item img").attr("src","img/list_select_n.png");
				$("#"+currentId+" img").attr("src","img/list_select_s.png");
			}
			else if(currentItem.indexOf("c_page_m_process_position_filename") != -1)
			{
				
				//点位文件名列表 page1
				var currentIndex = $("#"+currentId).attr("item-index");
				if(currentIndex != "")
				{
					objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex = currentIndex;
				}
				//objGlobalVariable.objCusUpdateTopState.arrayProgram[itemIndex];
				//加载文件列表
				objGlobalVariable.objCusUpdateTopState.updateProgramFileLine(currentIndex);
                                //显示程序-查看-子窗口
                                objGlobalVariable.objCusEventHandle.windowShowHideProgramView("page_process_m_position_fileline");
			}
			else if(currentItem.indexOf("c_page_m_process_position_fileline") != -1)
			{
				//文件列表序号
				//objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex;

				//点位文件数据列表 page2
				var currentIndex = $("#"+currentId).attr("item-index");
				var selFileNameIndex = objGlobalVariable.objCusUpdateTopState.selectProgramPositionIndex;
				var fileDataInfo = objGlobalVariable.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
				if(currentIndex != "")
				{
					fileDataInfo.selectLine = currentIndex;
				}
				//objGlobalVariable.objCusUpdateTopState.arrayProgram[itemIndex];
				$(".c_page_m_process_position_fileline img").attr("src","img/list_select_n.png");
				$("#"+currentId+" img").attr("src","img/list_select_s.png");
			}
			
		}
		
	}

	return false;

};
/* input 事件弹出框*/
CusNameSpace.CusEventHandle.prototype.evHandlPopInputShow=function() {

	//设置彃出 input 值为0
	$("#id_pop_light_input").val("");

	$("#id_pop_light_div").css("display","block");
	$("#id_pop_fade_div").css("display","block");

	//设置彃出 input 焦点
	document.getElementById('id_pop_light_input').focus();
=======
CusNameSpace.CusEventHandle.prototype.eventBtHandle = function (e) {

    var targetElement = $(e.target);
    var targetId = targetElement.attr("id");
    var targetClass = targetElement.attr("class");
    //Class
    if (targetClass.indexOf("cl_bt_page_state_m_map_list") !== -1)
    {
        //右下状态页 地图列表加载按钮
        window.objGlobalManage.objCusProtocol.func_set_load_map(targetElement);
    } else if (targetClass.indexOf("cl_bt_page_state_m_do_list") != -1)
    {
        //do
        window.objGlobalManage.objCusProtocol.func_set_do(targetElement);
    }
    else if(targetClass.indexOf("cl_bt_page_m_map_set_default") != -1)
    {
        //右下状态页 地图列表加载按钮
        window.objGlobalManage.objCusProtocol.func_set_default_map_name(targetElement);
    }


    //ID
    if (targetId === "modle_bt_login_general")
    {
        //操作员
        window.objGlobalManage.objCusUpdateTopState.variable_state_user = enumTypeUser.kUseGeneral;

        $("#modle_bt_login_general").css("background-color", "#3d4e60");
        $("#modle_bt_login_manager").css("background-color", "#337ab7");
    } else if (targetId === "modle_bt_login_manager")
    {
        //管理员
        window.objGlobalManage.objCusUpdateTopState.variable_state_user = enumTypeUser.kUserManage;
        $("#modle_bt_login_general").css("background-color", "#337ab7");
        $("#modle_bt_login_manager").css("background-color", "#3d4e60");
    } else if (targetId === "modle_bt_login")
    {
        //发送登录信息
        window.objGlobalManage.objCusProtocol.func_set_login();
    } else if (targetId === "id_top_pop_w_servo_open")
    {
        window.objGlobalManage.objCusProtocol.func_set_servo(1);
    } else if (targetId === "id_top_pop_w_servo_close")
    {
        window.objGlobalManage.objCusProtocol.func_set_servo(0);
    } else if (targetId === "id_top_pop_w_clear_msg")
    {
        window.objGlobalManage.objCusProtocol.func_set_clear_msg();
    } else if (targetId === "id_content_map_create_map")
    {
        window.objGlobalManage.objCusProtocol.func_set_create_map_start();
    } else if (targetId === "id_content_map_save_map")
    {
        //保存文件名
        window.objGlobalManage.objCusProtocol.func_set_save_map();
    } else if (targetId === "id_top_pop_w_odometer_zero")
    {
        //清除里程
        window.objGlobalManage.objCusProtocol.func_set_clear_odomter();
    } else if (targetId === "id_top_state_pop_w_mode_t1")
    {
        //模式T1
       window.objGlobalManage.objCusProtocol.func_set_mode(enumTypeMode.kModeT1);
    } else if (targetId === "id_top_state_pop_w_mode_t2")
    {
        //模式T２
        window.objGlobalManage.objCusProtocol.func_set_mode(enumTypeMode.kModeT2);
    } else if (targetId === "id_top_state_pop_w_mode_auto")
    {
        //自动
       window.objGlobalManage.objCusProtocol.func_set_mode(enumTypeMode.kModeAuto);
    } else if (targetId === "id_top_state_pop_w_mode_ext")
    {
        //自动
        window.objGlobalManage.objCusProtocol.func_set_mode(enumTypeMode.kModeExt);
    } else if (targetId === "id_top_state_pop_w_mode_fleet")
    {
        //fleet
        window.objGlobalManage.objCusProtocol.func_set_mode(enumTypeMode.kModeFleet);
    }else if (targetId === "id_top_state_pop_w_run_run")
    {
        //運行
        window.objGlobalManage.objCusProtocol.func_set_run();
    } else if (targetId === "id_top_state_pop_w_run_pause")
    {
        //暫停
       window.objGlobalManage.objCusProtocol.func_set_cease();
    } else if (targetId === "id_top_state_pop_w_run_stop")
    {
        //停止
        window.objGlobalManage.objCusProtocol.func_set_stop();
    } else if (targetId === "id_top_state_pop_w_run_open")
    {
        //打开程序-加载程序文件
       window.objGlobalManage.objCusProtocol.func_set_current_running_program_file();
    } 
    else if (targetId === "id_pop_w_process_fileline_open")
    {
        //打开程序-程序文件内容列表-加载程序文件
        window.objGlobalManage.objCusProtocol.func_set_current_running_program_file_in_fileline();
    }else if (targetId === "id_top_state_pop_w_set_default_file")
    {
        //打开程序-设置默认程序
        var itemIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramOpenIndex;
        var programName = window.objGlobalManage.objCusUpdateTopState.arrayProgramOpen[itemIndex];
        window.objGlobalManage.objCusProtocol.func_set_default_file_name(programName);
    }else if (targetId === "id_top_state_pop_w_set_line_number")
    {
        //打开程序-设置行号
        var selFileNameIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;
        if (selFileNameIndex >= 0)
        {
            var fileDataInfo = window.objGlobalManage.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
            var selFileLineIndex = parseInt(fileDataInfo.selectLine);
            window.objGlobalManage.objCusProtocol.func_set_run_line_number(selFileLineIndex);
        }
        else
        {
            popTipWindowMsg("没有选中有效的行");
        }
    }else if (targetId === "id_pop_w_process_file_dp_position_move")
    {
        //打开程序-程序文件内容列表-点显示-移动到点
        window.objGlobalManage.objCusProtocol.func_move_to_navgation_point();
        
    } else if (targetId === "connectWebsocket")
    {
        //web socket 连接   
        var serverIp = window.location.host;
        var serverPort = 8800;
        window.objGlobalManage.objWebSocket.setServerIpPort(serverIp, serverPort);
        window.objGlobalManage.objWebSocket.initWebSocket();
        $("#modle_bt_login_msg").text("正在连接服务器...");

    } else if (targetId === "closeWebsocket")
    {
        //web socket 关闭   
        window.objGlobalManage.objWebSocket.stopWebSocket();

    }else if (targetId === "testDownLog")
    {
        //web socket 关闭   
        window.objGlobalManage.objDebugOut.downloadLog();
    }
    else if (targetId === "id_pop_w_set_position_initial")
    {
        //设置初始位置
        var cmdRowParent = {};
        var cmdRowChild = {};

        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.position_x = window.objGlobalManage.objCusUpdateTopState.position_x;
        cmdRowChild.position_y = window.objGlobalManage.objCusUpdateTopState.position_y;
        cmdRowChild.position_r = window.objGlobalManage.objCusUpdateTopState.position_r;

        cmdRowParent.set_vehicle_initial_position = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);
    } else if (targetId === "id_pop_w_process_fileline_back")
    {
        //程序点位文件数据列表返回
        //显示程序-查看-子窗口
        window.objGlobalManage.objCusEventHandle.windowShowHideProgramView("page_process_m_position_filename");
        
    } else if (targetId === "id_pop_w_process_file_dp_position_back")
    {
        //程序读取点位置返回
        window.objGlobalManage.objCusEventHandle.windowShowHideProgramView("page_process_m_position_fileline");
    } 
    else if (targetId === "id_pop_w_process_file_dp_position_set")
    {
        //程序设置点位置
        window.objGlobalManage.programSetVehiclePostion = 1;
        this.evHandlPopInputShow();
    } 
    else if (targetId === "id_content_set_shutdown")
    {
        window.objGlobalManage.shutdownPwdInput = 1;
        this.evHandlPopInputShow();
    } 
    else if (targetId === "id_content_set_restart")
    {
        window.objGlobalManage.shutdownPwdInput = 2;
        this.evHandlPopInputShow();

    }
    else if (targetId === "id_pop_w_process_fileline_load")
    {
        //载入点判断是否是停止状态
        if(window.objGlobalManage.objCusUpdateTopState.variable_state_run !== enumTypeExecuteState.kStateCease )
        {
            window.objGlobalManage.tipsCeaseProgramForRecordDp=1;
            $("#top_right_state_run").trigger("click");
            return;
        }
       
        var selFileNameIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;
        if (selFileNameIndex >= 0)
        {
            var fileDataInfo = window.objGlobalManage.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
            var selFileLineIndex = fileDataInfo.selectLine;
            var stringLine = fileDataInfo.arrayFileDataEn[selFileLineIndex];
            
             /*
            DP[2] 71%,LASER,FINE,LINE,P,0.1,OP,Laser[1],DET:0
            2:1
            71:2
            LASER:3
            FINE:4
            LINE:5
            P:6
            0.1:7
            OP:8
            undefined:9
            undefined:10
            undefined:11
            OP:12
            1:13
            DET:14

            DP[1] 100%,IMU,FINE,LINE,P,0.1,VMark[0],Laser[0],NODET:0
            1:1
            100:2
            IMU:3
            FINE:4
            LINE:5
            P:6
            0.1:7
            VMark[0]:8
            VMark[0]:9
            VMark:10
            0:11
            undefined:12
            0:13
            NODET:14*/
            var reg=/DP\[(\d+)\]\s+(\d+)\%\s*[,]\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\w+)\s*,\s*(\d+\.\d+)\s*,((\s*(\w+)\[(\d+)\]\s*)|(OP)),\s*\w+\[(\d+)\]\s*,\s*(\w+)/;
            var dataValue = stringLine;
            var arrAnalyze = reg.exec(dataValue);
           
            if(arrAnalyze[8] == "OP")
            {
                //普通点
                var cmdRowParent = {};
                var cmdRowChild = {};
                cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
                cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
                cmdRowChild.program_file_name = fileDataInfo.fileName;
                cmdRowChild.map_name = window.objGlobalManage.objCusUpdateTopState.variable_map_name;
                cmdRowChild.dp_type=enumTypeInstructionDpType.kDpTypeOp;
                cmdRowChild.dpoint_index = arrAnalyze[1].toString();
                cmdRowChild.dpoint_x = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_map_x * 1000.0;
                cmdRowChild.dpoint_y = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_map_y * 1000.0;
                cmdRowChild.dpoint_r = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_map_r * 180 / 3.1415926;
                cmdRowParent.set_record_dpoint = cmdRowChild;
                if(window.objGlobalManage.objCusUpdateTopState.is_current_vehicle_position_map_sucess == 0)
                {
                    popTipWindowMsg("普通点位置获取失败！")
                }
                else
                {
                    var sendData = JSON.stringify(cmdRowParent);
                    window.objGlobalManage.objWebSocket.sendMessage(sendData);
                }
                
            }
            else
            {
                if(arrAnalyze[10] == "VMark")
                {
                    var cmdRowParent = {};
                    var cmdRowChild = {};

                    cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
                    cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
                    cmdRowChild.program_file_name = fileDataInfo.fileName;
                    cmdRowChild.map_name = window.objGlobalManage.objCusUpdateTopState.variable_map_name;
                    cmdRowChild.dpoint_index = arrAnalyze[1].toString();
                    cmdRowChild.dp_type=enumTypeInstructionDpType.kDpTypeVmark;
                    cmdRowChild.dpoint_x = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_vmark_x * 1000;
                    cmdRowChild.dpoint_y = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_vmark_y * 1000;
                    cmdRowChild.dpoint_r = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_vmark_r * 180 / 3.1415926;
                    cmdRowParent.set_record_dpoint = cmdRowChild;
                    
                    if(window.objGlobalManage.objCusUpdateTopState.is_current_vehicle_position_vmark_sucess == 0)
                    {
                        popTipWindowMsg("V槽点位置获取失败！")
                    }
                    else
                    {
                        var sendData = JSON.stringify(cmdRowParent);
                        window.objGlobalManage.objWebSocket.sendMessage(sendData);
                    }
                    
                    
                }
                else if(arrAnalyze[10] == "QR")
                {
                    var cmdRowParent = {};
                    var cmdRowChild = {};

                    cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
                    cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
                    cmdRowChild.program_file_name = fileDataInfo.fileName;
                    cmdRowChild.map_name = window.objGlobalManage.objCusUpdateTopState.variable_map_name;
                    cmdRowChild.dpoint_index = arrAnalyze[1].toString();
                    cmdRowChild.dp_type=enumTypeInstructionDpType.kDpTypeQrCode;
                    cmdRowChild.dpoint_x = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_qrcode_x * 1000;
                    cmdRowChild.dpoint_y = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_qrcode_y * 1000;
                    cmdRowChild.dpoint_r = window.objGlobalManage.objCusUpdateTopState.current_vehicle_position_qrcode_r * 180 / 3.1415926;
                    cmdRowParent.set_record_dpoint = cmdRowChild;
                    
                    if(window.objGlobalManage.objCusUpdateTopState.is_current_vehicle_position_qrcode_sucess == 0)
                    {
                        popTipWindowMsg("二维码点位置获取失败！")
                    }
                    else
                    {
                        var sendData = JSON.stringify(cmdRowParent);
                        window.objGlobalManage.objWebSocket.sendMessage(sendData); 
                    }
                    
                    
                }
            }
        }
    } else if (targetId === "id_pop_w_process_fileline_read")
    {
        //程序点位文件数据列表读取
        var selFileNameIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;
        if (selFileNameIndex >= 0)
        {
            var fileDataInfo = window.objGlobalManage.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];
            var selFileLineIndex = fileDataInfo.selectLine;
            var stringLine = fileDataInfo.arrayFileDataEn[selFileLineIndex];

            if (stringLine.indexOf("DP[") != -1)
            {
                //vmark值获取
                var dpIndex = -1;
                var vmarkIndex = -1;
                //截取DP点
                {
                    var strItem = "";
                    var splitFlag = "";
                    var tempData = stringLine;
                    splitFlag = tempData.indexOf("DP[");
                    splitLen = tempData.length - splitFlag;
                    tempData = tempData.substr(splitFlag, splitLen);

                    splitFlag = tempData.indexOf("DP[") + 3;
                    var splitLen = 0;

                    splitLen = tempData.length - splitFlag;

                    strItem = tempData.substr(splitFlag, splitLen);
                    splitFlag = strItem.indexOf("]");
                    strItem = strItem.substr(0, splitFlag);
                    dpIndex = strItem;
                }

                var cmdRowParent = {};
                var cmdRowChild = {};
                var currentFileIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;
                var programPositionInfo = window.objGlobalManage.objCusUpdateTopState.arrayProgramPosition[currentFileIndex];

                cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
                cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
                //cmdRowChild.program_file_name=fileDataInfo.fileName;
                //cmdRowChild.map_name=window.objGlobalManage.objCusUpdateTopState.variable_map_name;
                cmdRowChild.point_index = dpIndex;
                cmdRowChild.file_name = programPositionInfo.fileName;
                cmdRowParent.get_dpoint = cmdRowChild;
                var sendData = JSON.stringify(cmdRowParent);
                window.objGlobalManage.objWebSocket.sendMessage(sendData);

                //记录当前选择的指令
                window.objGlobalManage.programSelInstraction=stringLine;
            }
        }
    } else if (targetId === "id_set_vmark_commit")
    {
        //
        window.objGlobalManage.objCusProtocol.func_set_vmark_type();
    } 
    else if (targetId === "id_set_vmark_laserfilter_commit")
    {
        // vmark laser filter number 激光滤波设置
        window.objGlobalManage.objCusProtocol.func_set_vmark_laser_filter_type();
    } 
    else if (targetId === "id_top_pop_user")
    {
        //当前用户 重新登陆
        window.location.reload();
    } else if (targetId === "id_bt_avoid_ultrasonicsensor_enable")
    {
       window.objGlobalManage.objCusProtocol.func_set_ultrasonic_sensor_check_enable();

    } else if (targetId === "id_bt_avoid_pointcloud_enable")
    {
        window.objGlobalManage.objCusProtocol.func_set_point_cloud_check_enable();

    } 
    else if (targetId === "id_content_manual_window_bt_det")
    {

        window.objGlobalManage.objCusProtocol.func_set_point_cloud_check_enable();
        window.objGlobalManage.objCusProtocol.func_set_ultrasonic_sensor_check_enable();

    } 
    else if (targetId === "id_pag_set_bt_register")
    {
        //发送注册
        var serialNumber = "";
        serialNumber = $("#modle_in_set_register").val();
        if (serialNumber.length != 30)
        {
            popTipWindowMsg("请输入正确的注册码");
        } else
        {
            var cmdRowParent = {};
            var cmdRowChild = {};
            var vmarkValue = "";
            vmarkValue = $("#id_content_set_vmark_type").val();

            cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
            cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
            //cmdRowChild.program_file_name=fileDataInfo.fileName;
            //cmdRowChild.map_name=window.objGlobalManage.objCusUpdateTopState.variable_map_name;
            cmdRowChild.license_number = serialNumber;
            cmdRowParent.set_register = cmdRowChild;
            var sendData = JSON.stringify(cmdRowParent);
            window.objGlobalManage.objWebSocket.sendMessage(sendData);
        }
    } 
    else if (targetId === "id_set_callpoint_commit")
    {
        //
        var objCusCallVehicle = new CusNameSpace.CusCallVehicle();
        var position = $("#id_content_set_callpoint").val();
        objCusCallVehicle.target_position = parseInt(position);
        objCusCallVehicle.comment = "";
        objCusCallVehicle.user_ip = window.location.host.toString();
        window.objGlobalManage.objCusProtocol.func_set_call_vehicle(objCusCallVehicle); 
    }
    else if (targetId === "id_set_callpoint_commit1")
    {
        //
        var objCusCallVehicle = new CusNameSpace.CusCallVehicle();
        var position = $("#id_content_set_callpoint1").val();
        objCusCallVehicle.target_position = parseInt(position);
        objCusCallVehicle.comment = "";
        objCusCallVehicle.user_ip = window.location.host.toString();
        window.objGlobalManage.objCusProtocol.func_set_call_vehicle(objCusCallVehicle);
    }
    else if (targetId === "id_set_callpoint_commit2")
    {
        //
        var objCusCallVehicle = new CusNameSpace.CusCallVehicle();
        var position = $("#id_content_set_callpoint2").val();
        objCusCallVehicle.target_position = parseInt(position);
        objCusCallVehicle.comment = "";
        objCusCallVehicle.user_ip = window.location.host.toString();
        window.objGlobalManage.objCusProtocol.func_set_call_vehicle(objCusCallVehicle); 
    }
    else if (targetId === "id_set_callpoint_commit3")
    {
        //
        var objCusCallVehicle = new CusNameSpace.CusCallVehicle();
        var position = $("#id_content_set_callpoint3").val();
        objCusCallVehicle.target_position = parseInt(position);
        objCusCallVehicle.comment = "";
        objCusCallVehicle.user_ip = window.location.host.toString();
        window.objGlobalManage.objCusProtocol.func_set_call_vehicle(objCusCallVehicle); 
    }
    else if (targetId === "")
    {
        //
    }
};
CusNameSpace.CusEventHandle.prototype.refreshSliderCmdHandle = function (elelementId, value) {

    var elementId = elelementId;
    if (elementId == "slider-1")
    {
        //手动速度
        window.objGlobalManage.objCusUpdateTopState.variable_state_manual_v = value;
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.ratio = window.objGlobalManage.objCusUpdateTopState.variable_state_manual_v;

        cmdRowParent.set_manual_ratio = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);
    } else if (elementId == "slider-2")
    {
        //自动速度
        window.objGlobalManage.objCusUpdateTopState.variable_state_auto_v = value;
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.ratio = window.objGlobalManage.objCusUpdateTopState.variable_state_auto_v;

        cmdRowParent.set_auto_ratio = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);
    }

};

//div事件
CusNameSpace.CusEventHandle.prototype.eventDivHandle = function (e) {

    var targetElement = $(e.target);
    var itemDiv = new Array();
    var itemId = new Array();

    itemDiv[0] = targetElement.attr("class");
    itemId[0] = targetElement.attr("id");
    itemDiv[1] = targetElement.parent().attr("class");
    itemId[1] = targetElement.parent().attr("id");
    itemDiv[2] = targetElement.parent().parent().attr("class");
    itemId[2] = targetElement.parent().parent().attr("id");
    itemDiv[3] = targetElement.parent().parent().parent().attr("class");
    itemId[3] = targetElement.parent().parent().parent().attr("id");

    for (var itemIndex = 0; itemIndex < 4; itemIndex++)
    {
        var currentItem = itemDiv[itemIndex];
        var currentId = itemId[itemIndex];
        if (typeof (currentItem) != "undefined")
        {
            if (currentItem.indexOf("primary_nva") != -1)
            {
                this.evHandlPrimaryState(itemId[itemIndex], "block_second_menu");
                $(".primary_nva").removeClass("primary_nva_active");
                $("#" + itemId[itemIndex]).addClass("primary_nva_active");

                //初始化程序界面子窗口
                if(window.objGlobalManage.jumpProgramFileStringWindowOpen === 0)
                {
                    window.objGlobalManage.objCusEventHandle.windowShowHideProgramView("page_process_m_position_filename"); 
                }
                //请求数据
                this.requestDivState(itemId[itemIndex]);
            } else if (currentItem.indexOf("second_menu_nva") != -1)
            {
                this.evHandlSecondMenu(itemId[itemIndex]);
                $(".second_menu_nva").removeClass("second_menu_nva_active");
                $("#" + itemId[itemIndex]).addClass("second_menu_nva_active");
                //请求数据
                this.requestDivState(itemId[itemIndex]);
            } else if (currentItem.indexOf("top_menu_nva") != -1)
            {
                //顶部按钮按下事件
                this.evHandlTopState(itemId[itemIndex]);
                
                if(currentId === "top_right_state_run")
                {
                    if(window.objGlobalManage.tipsCeaseProgramForRecordDp === 1)
                    {
                        //弹出运行控制窗口
                        $("#top_state_window_run p").text("请先停止程序");
                        window.objGlobalManage.tipsCeaseProgramForRecordDp = 0;
                    }
                    else
                    {
                        $("#top_state_window_run p").text("");
                    }
                }
                else if(currentId === "top_right_state_modle")
                {
                     if(window.objGlobalManage.tipsManualMustBeT1T2 === 1)
                    {
                        //弹出模式控制窗口
                        $("#id_top_state_window_mode_tips_msg").text("请切换到手动T1,或者T2模式");
                        window.objGlobalManage.tipsManualMustBeT1T2 = 0;
                    }
                    else
                    {
                        $("#id_top_state_window_mode_tips_msg").text("");
                    }
                }

                $(".top_menu_nva").removeClass("top_menu_nva_active");
                $("#" + itemId[itemIndex]).addClass("top_menu_nva_active");

                this.requestDivState(itemId[itemIndex]);
            } else if (currentItem.indexOf("c_second_menu_list_item") != -1)
            {
                $(".c_second_menu_list_item").css("background-color", "#3d4151");
                $("#" + itemId[itemIndex]).css("background-color", "#3d4e60");
            } else if (currentItem.indexOf("c_pop_black_overlay_input") != -1)
            {
                this.requestDivState(itemId[itemIndex]);
            } else if (currentItem.indexOf("c_page_state_m_process_item") != -1)
            {
                //程序打开
                var currentIndex = $("#" + currentId).attr("item-index");

                if (currentIndex != "")
                {
                    window.objGlobalManage.objCusUpdateTopState.selectProgramOpenIndex = currentIndex;
                }

                $(".c_page_state_m_process_item").removeClass("c_page_state_m_systeminfo_text_sel");
                $("#" + currentId).addClass("c_page_state_m_systeminfo_text_sel");
            } else if (currentItem.indexOf("c_page_m_process_position_filename") != -1)
            {
                //点位文件名列表 page1
                var currentIndex = $("#" + currentId).attr("item-index");
                if (currentIndex != "")
                {
                    window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex = currentIndex;
                }
                //window.objGlobalManage.objCusUpdateTopState.arrayProgram[itemIndex];
                //加载文件列表
                window.objGlobalManage.objCusUpdateTopState.updateProgramFileLine(currentIndex);
                //显示程序-查看-子窗口
                window.objGlobalManage.objCusEventHandle.windowShowHideProgramView("page_process_m_position_fileline");
                
            } else if (currentItem.indexOf("c_page_m_process_position_fileline") != -1)
            {
                //文件列表序号
                //window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;

                //点位文件数据列表 page2
                var currentIndex = $("#" + currentId).attr("item-index");
                var selFileNameIndex = window.objGlobalManage.objCusUpdateTopState.selectProgramPositionIndex;
                var fileDataInfo = window.objGlobalManage.objCusUpdateTopState.arrayProgramPosition[selFileNameIndex];

                if (currentIndex != "")
                {
                    fileDataInfo.selectLine = currentIndex;
                }
                //window.objGlobalManage.objCusUpdateTopState.arrayProgram[itemIndex];

                $(".c_page_m_process_position_fileline").removeClass("c_page_state_m_systeminfo_text_sel");
                $("#" + currentId).addClass("c_page_state_m_systeminfo_text_sel");
            }

        }

    }

    return false;

};
/* input 事件弹出框*/
CusNameSpace.CusEventHandle.prototype.evHandlPopInputShow = function () {

    //设置彃出 input 值为0
    $("#id_pop_light_input").val("");

    $("#id_pop_light_div").css("display", "block");
    $("#id_pop_fade_div").css("display", "block");

    //设置彃出 input 焦点
    document.getElementById('id_pop_light_input').focus();
>>>>>>> dev
};

function isNumber(val) {
    var regPos = /^\d+(\.\d+)?$/; //非负浮点数
    var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
<<<<<<< HEAD
    if(regPos.test(val) || regNeg.test(val)) {
        return true;
        } else {
        return false;
        }
    }

CusNameSpace.CusEventHandle.prototype.evHandlPopInputHide=function() {


	var recordInputId = objGlobalVariable.objCusUpdateTopState.foucsInputId;
	var popInputText = "";

	popInputText = $("#id_pop_light_input").val();

	if(typeof(recordInputId) != "undefined")
	{
                if(recordInputId == "id_content_set_vmark_type")
                {
                    //vmark判断是否输入的是数字
                    if(isNumber(popInputText))
                    {
                        $("#"+recordInputId).val(popInputText);
                    }
                    else
                    {
                        popTipWindowMsg("请重新输入Vmark类型，Vmark类型为数字");
                    }

                }
                else
                {
                    $("#"+recordInputId).val(popInputText);
                }
	}
        
	$("#id_pop_light_div").css("display","none");
	$("#id_pop_fade_div").css("display","none");

	// 发送授权密码
	if(objGlobalVariable.programSetVehiclePostion == 1)
	{
		objGlobalVariable.programSetVehiclePostion = 0;

		if(popInputText == "123456")
		{
			var cmdRowParent = {};
			var cmdRowChild = {};
			cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
			cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
			cmdRowChild.position_x=objGlobalVariable.objCusUpdateTopState.read_dpoint_x;
			cmdRowChild.position_y=objGlobalVariable.objCusUpdateTopState.read_dpoint_y;
			cmdRowChild.position_r=objGlobalVariable.objCusUpdateTopState.read_dpoint_r;
	
			cmdRowParent.set_vehicle_initial_position = cmdRowChild;
			var sendData=JSON.stringify(cmdRowParent);
	
			objGlobalVariable.objWebSocket.sendMessage(sendData);
		}
	}

};
//input 键盘彃出处理
CusNameSpace.CusEventHandle.prototype.eventRecordInputHandle=function(e) {

	var targetElement = $(e.target);
	var elementId = targetElement.attr("id");

	if(elementId != "id_pop_light_input")
	{
		//过虑处理input键盘覆盖的弹出框口上面的input
		objGlobalVariable.objCusUpdateTopState.foucsInputId = targetElement.attr("id");
		this.evHandlPopInputShow();
	}

	
=======
    if (regPos.test(val) || regNeg.test(val)) {
        return true;
    } else {
        return false;
    }
}

CusNameSpace.CusEventHandle.prototype.evHandlPopInputHide = function () {


    var recordInputId = window.objGlobalManage.objCusUpdateTopState.foucsInputId;
    var popInputText = "";

    popInputText = $("#id_pop_light_input").val();

    if (typeof (recordInputId) != "undefined")
    {
        if (recordInputId == "id_content_set_vmark_type")
        {
            //vmark判断是否输入的是数字
            if (isNumber(popInputText))
            {
                $("#" + recordInputId).val(popInputText);
            } else
            {
                popTipWindowMsg("请重新输入Vmark类型，Vmark类型为数字");
            }

        }
        else if (recordInputId == "id_content_set_vmark_laserfilter")
        {
            //vmark判断是否输入的是数字
            if (isNumber(popInputText))
            {
                $("#" + recordInputId).val(popInputText);
            } else
            {
                popTipWindowMsg("请重新输入激光滤波类型，激光滤波类型为数字");
            }

        }else
        {
            $("#" + recordInputId).val(popInputText);
        }
    }

    $("#id_pop_light_div").css("display", "none");
    $("#id_pop_fade_div").css("display", "none");

    // 发送授权密码
    if (window.objGlobalManage.programSetVehiclePostion === 1)
    {
        window.objGlobalManage.programSetVehiclePostion = 0;

        if (popInputText === "123456")
        {
            var cmdRowParent = {};
            var cmdRowChild = {};
            cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
            cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
            
            cmdRowChild.position_x =  window.objGlobalManage.objCusProgramMode.read_dpoint_x/1000;
            cmdRowChild.position_y =  window.objGlobalManage.objCusProgramMode.read_dpoint_y/1000;
            cmdRowChild.position_r =  window.objGlobalManage.objCusProgramMode.read_dpoint_r*3.1415926/180;

            cmdRowParent.set_vehicle_initial_position = cmdRowChild;
            var sendData = JSON.stringify(cmdRowParent);

            window.objGlobalManage.objWebSocket.sendMessage(sendData);
        }
    }
    if(window.objGlobalManage.shutdownPwdInput === 1)
    {
        window.objGlobalManage.shutdownPwdInput = 0;

        if (popInputText === "123456")
        {
            window.objGlobalManage.objCusProtocol.func_set_shutdown(enumTypeShutDownType.kShutDown);
             popTipWindowMsg("5秒后将关闭主机！");
        }
        else
        {
            popTipWindowMsg("密码不正确，请重新尝试！");
        }
    }
    else if(window.objGlobalManage.shutdownPwdInput === 2)
    {
        window.objGlobalManage.shutdownPwdInput = 0;

        if (popInputText === "123456")
        {
           window.objGlobalManage.objCusProtocol.func_set_shutdown(enumTypeShutDownType.kReboot);
           popTipWindowMsg("5秒后将重新启动主机！");
        }
        else
        {
           popTipWindowMsg("密码不正确，请重新尝试！");
        }
    }

};
//input 键盘彃出处理
CusNameSpace.CusEventHandle.prototype.eventRecordInputHandle = function (e) {

    var targetElement = $(e.target);
    var elementId = targetElement.attr("id");

    if (elementId != "id_pop_light_input")
    {
        //过虑处理input键盘覆盖的弹出框口上面的input
        window.objGlobalManage.objCusUpdateTopState.foucsInputId = targetElement.attr("id");
        this.evHandlPopInputShow();
    }


>>>>>>> dev
};



//登陆成功
function handleLoginSuccess() {
<<<<<<< HEAD
	$("#modle_login").css("display","none");
};
//左侧菜单请求数据
CusNameSpace.CusEventHandle.prototype.requestDivState=function(secondMenuIdName) {
	
	
	if( secondMenuIdName === "top_right_state_msg" )
	{
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;

		cmdRowParent.get_msg_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);

		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(secondMenuIdName === "second_process_open")
	{
		var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;

		cmdRowParent.get_robot_program_file_list = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);

		objGlobalVariable.objWebSocket.sendMessage(sendData);
                
                
	}
	else if(secondMenuIdName === "robot_running_program_files_info")
	{
                //位置

                var cmdRowParent = {};
		var cmdRowChild = {};

		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;

		cmdRowParent.get_robot_running_program_files_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);

		objGlobalVariable.objWebSocket.sendMessage(sendData);
                
                
                
	}
	else if(secondMenuIdName === "second_process_position")
	{
            
		var cmdRowParent = {};
		var cmdRowChild = {};
		//正在运行的程序
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;

		cmdRowParent.get_robot_program_files_strings = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);

		objGlobalVariable.objWebSocket.sendMessage(sendData);

		//显示文件列表-第一个页面
                 //显示程序-查看-子窗口
                 objGlobalVariable.objCusEventHandle.windowShowHideProgramView("page_process_m_position_filename");
	}
	else if(secondMenuIdName === "second_map_list")
	{
		//如果是地图列表按钮　发送获取地图命令
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		cmdRowParent.get_map_list = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
	}
	else if(secondMenuIdName === "second_only_state_ioinfo")
	{
		//DI
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		cmdRowParent.get_dido_value_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);

	}
        else if(secondMenuIdName === "second_state_ioinfo")
	{
            
            //io名字与状态
            //DI
		var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		cmdRowParent.get_di_name_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);

		//DIDO
		//删除DI对象
		delete cmdRowParent.get_di_name_info;
		cmdRowParent.get_dido_value_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
		

		//DO
		//删除DIDO对象
		delete cmdRowParent.get_dido_value_info;
		cmdRowParent.get_do_name_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
		

	}
	else if(secondMenuIdName === "id_pop_fade_div")
	{
		//隐藏弹出input
		this.evHandlPopInputHide();
	}
        else if(secondMenuIdName === "second_state_avoid_info")
	{
            //获取超声波检测数据
            {
                var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		cmdRowParent.get_ultrasonic_sensor_check_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
                
 
            }
            //获取点云检测数据
            {
                var cmdRowParent = {};
		var cmdRowChild = {};
		cmdRowChild.user_type=objGlobalVariable.objCusUpdateTopState.variable_state_user;
		cmdRowChild.user_password=objGlobalVariable.objCusUpdateTopState.loginPassWd;
		cmdRowChild.parameter=0;
		cmdRowParent.get_point_cloud_check_info = cmdRowChild;
		var sendData=JSON.stringify(cmdRowParent);
		objGlobalVariable.objWebSocket.sendMessage(sendData);
            }
                
	}
	else if(secondMenuIdName === "")
	{

	}

	
};


//程序－查看－窗口显示
CusNameSpace.CusEventHandle.prototype.windowShowHideProgramView=function(windowId) {
    
        $(".c_page_program_sub_window").css("display","none");
        $("#"+windowId).css("display","block");
};






=======
    $("#modle_login").css("display", "none");
    //手动速度初始化
    if(window.objGlobalManage.objCusUpdateTopState.loginState === enumTypeLoginResult.kLoginSuccess)
    {
        
        $("#func_manual").trigger("click");
    }
}
;
//左侧菜单请求数据
CusNameSpace.CusEventHandle.prototype.requestDivState = function (secondMenuIdName) {


    if (secondMenuIdName === "top_right_state_msg")
    {
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;

        cmdRowParent.get_msg_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);

        window.objGlobalManage.objWebSocket.sendMessage(sendData);
        
    } else if (secondMenuIdName === "second_process_open")
    {
        var cmdRowParent = {};
        var cmdRowChild = {};

        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;

        cmdRowParent.get_robot_program_file_list = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);

        window.objGlobalManage.objWebSocket.sendMessage(sendData);
        
    } else if (secondMenuIdName === "robot_running_program_files_info")
    {
        //位置

        var cmdRowParent = {};
        var cmdRowChild = {};

        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;

        cmdRowParent.get_robot_running_program_files_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);

        window.objGlobalManage.objWebSocket.sendMessage(sendData);



    } else if (secondMenuIdName === "second_process_position")
    {

        window.objGlobalManage.objCusProtocol.func_get_robot_program_files_strings();
        
    } else if (secondMenuIdName === "second_map_list")
    {
        //如果是地图列表按钮发送获取地图命令
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;
        cmdRowParent.get_map_list = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);       
    } else if (secondMenuIdName === "second_only_state_ioinfo")
    {
        //DI
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;
        cmdRowParent.get_dido_value_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);

    } else if (secondMenuIdName === "second_state_ioinfo")
    {

        //io名字与状态
        //DI
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;
        cmdRowParent.get_di_name_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);

        //DIDO
        //删除DI对象
        delete cmdRowParent.get_di_name_info;
        cmdRowParent.get_dido_value_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);


        //DO
        //删除DIDO对象
        delete cmdRowParent.get_dido_value_info;
        cmdRowParent.get_do_name_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);


    } else if (secondMenuIdName === "id_pop_fade_div")
    {
        //隐藏弹出input
        this.evHandlPopInputHide();
    } else if (secondMenuIdName === "second_state_avoid_info")
    {
        //获取超声波检测数据
        {
            var cmdRowParent = {};
            var cmdRowChild = {};
            cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
            cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
            cmdRowChild.parameter = 0;
            cmdRowParent.get_ultrasonic_sensor_check_info = cmdRowChild;
            var sendData = JSON.stringify(cmdRowParent);
            window.objGlobalManage.objWebSocket.sendMessage(sendData);
        }
        //获取点云检测数据
        {
            var cmdRowParent = {};
            var cmdRowChild = {};
            cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
            cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
            cmdRowChild.parameter = 0;
            cmdRowParent.get_point_cloud_check_info = cmdRowChild;
            var sendData = JSON.stringify(cmdRowParent);
            window.objGlobalManage.objWebSocket.sendMessage(sendData);
        }

    } else if (secondMenuIdName === "second_set_version")
    {
        //获取版本信息
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;
        cmdRowParent.get_version_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);

    } else if (secondMenuIdName === "second_set_register")
    {
        //获取注册信息
        var cmdRowParent = {};
        var cmdRowChild = {};
        cmdRowChild.user_type = window.objGlobalManage.objCusUpdateTopState.variable_state_user;
        cmdRowChild.user_password = window.objGlobalManage.objCusUpdateTopState.loginPassWd;
        cmdRowChild.parameter = 0;
        cmdRowParent.get_register_info = cmdRowChild;
        var sendData = JSON.stringify(cmdRowParent);
        window.objGlobalManage.objWebSocket.sendMessage(sendData);

    } else if (secondMenuIdName === "second_state_vmark_info")
    {
        window.objGlobalManage.objCusProtocol.func_get_vmark_debug_info();
    }
    else if (secondMenuIdName === "")
    {

    }

};


//程序－查看－窗口显示
CusNameSpace.CusEventHandle.prototype.windowShowHideProgramView = function (windowId) {

    $(".c_page_program_sub_window").css("display", "none");
    $("#" + windowId).css("display", "block");
    
    if(windowId === "page_process_m_position_fileline")
    {
        window.objGlobalManage.jumpProgramFileStringWindowOpen=1;
    }
    else
    {
        window.objGlobalManage.jumpProgramFileStringWindowOpen=0;
    }

};


//方向
function selectProgramDirectionOnchang(obj){ 
//获取被选中的option标签选项 
    if(obj.selectedIndex===0)
    {
        window.objGlobalManage.objCusProtocol.instruction_direction = 0;
    }
    else if(obj.selectedIndex===1)
    {
        window.objGlobalManage.objCusProtocol.instruction_direction = 1;
    }
};
function selectProgramDetectOnchang(obj){ 
    //获取被选中的option标签选项
    if(obj.selectedIndex===0)
    {
        window.objGlobalManage.objCusProtocol.instruction_detect = 0;
    }
    else if(obj.selectedIndex===1)
    {
        window.objGlobalManage.objCusProtocol.instruction_detect = 1;
    }
};
//设置-语言-程序显示语言
function selectProgramLanguageOnchang(obj){ 
    //获取被选中的option标签选项
    var languageType=enumTypeProgramLanguageType.kLanuageCh;
    if(obj.selectedIndex===enumTypeProgramLanguageType.kLanuageCh)
    {
        window.objGlobalManage.objCusProgramMode.languageProgramString = enumTypeProgramLanguageType.kLanuageCh;
    }
    else if(obj.selectedIndex===1)
    {
        window.objGlobalManage.objCusProgramMode.languageProgramString = enumTypeProgramLanguageType.kLanuageEn;
    }
    languageType=window.objGlobalManage.objCusProgramMode.languageProgramString;  
    window.objGlobalManage.objCusCookie.setProgramLanguage(languageType);
};
>>>>>>> dev
